<?php

use think\Facade\Route;
use think\Facade\Env;

Route::domain(Env::get('app.peoples_url'), function () {
    header("Access-Control-Allow-Origin: *");
    header('Access-Control-Allow-Methods: POST, PUT, GET, OPTIONS, DELETE, HEAD, PATCH');
    header("Access-Control-Allow-Headers: token,tokens,language, Origin, X-Requested-With, Content-Type, Accept");
    Route::miss(function () {
        echo '无访问权限';
        exit();
    });

    Route::group('Recpeople', function () {
        Route::rule('register', '/register'); //注册
        Route::rule('login', '/login'); //登录
        Route::get('orderlist', '/orderlist'); //订单大厅
        Route::post('jorder', '/jorder'); //订单大厅
        Route::post('zorder', '/zorder'); //订单大厅
        Route::post('orderfinish', '/orderfinish'); //订单大厅
        Route::post('authpeople', '/authpeople'); //订单大厅
        Route::post('joinbusiness', '/joinbusiness'); //订单大厅
        Route::post('unjoinbusiness', '/unjoinbusiness'); //订单大厅
        Route::rule('peoplearea', '/peoplearea'); //订单大厅
        Route::rule('peopleproject', '/peopleproject'); //订单大厅
        Route::get('getbusiness', '/getbusiness'); //订单大厅
        Route::get('info', '/info'); //订单大厅
    })->prefix('Recpeople');
    Route::group('Other', function () {
        Route::get('getstreet', '/getstreet'); //获取地址
        Route::get('addressjson', '/addressjson'); //获取本地地址库
        Route::get('getclass', '/getclass'); //平台分类
        Route::get('getgoodsclass', '/getgoodsclass'); //首页热推
        Route::get('getsonclass', '/getsonclass'); //平台子分类
        Route::get('goodsdetail', '/goodsdetail'); //商品详情
        Route::get('banner', '/banner'); //轮播图
        Route::get('goodslist', '/goodslist'); //商品列表
        Route::get('business', '/business'); //商品列表
        Route::rule('oss', '/oss'); //商品列表
        Route::get('user_level', '/user_level'); //商品列表
        Route::rule('callback', '/callback'); //商品列表
        Route::get('street', '/street'); //提交订单
        Route::get('others', '/others'); //提交订单
    })->prefix('Other');
})->bind('people')->prefix('people');
